﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

using FinalProject.Data.Sort;

namespace FinalProject.Data.Search
{
    public class SearchQuery<T>
    {
        public SearchQuery()
        {
            Filters = new List<Expression<Func<T, bool>>>();
            SortCriterias = new List<ISortCriteria<T>>();
        }

        public List<Expression<Func<T, bool>>> Filters { get; protected set; }

        public void AddFilter(Expression<Func<T, bool>> filter)
        {
            Filters.Add(filter);
        }

        public List<ISortCriteria<T>> SortCriterias
        {
            get;
            protected set;
        }

        public void AddSortCriteria(ISortCriteria<T> sortCriteria)
        {
            SortCriterias.Add(sortCriteria);
        }

        public string IncludeProperties { get; set; }

        public int Skip { get; set; }

        public int Take { get; set; }
    }
}
